package com.bluegalaxy.nhb.snservice.common.builder;


import com.bluegalaxy.nhb.snservice.domain.vo.ReturnObject;

/**
 * Created by IntelliJ IDEA.
 *
 * @author:
 * @date: 2020-02-11
 * @time: 16:54
 * @description: 返回值生成器
 * To change this template use File | Settings | File Templates.
 */
public class ReturnObjectBuilder {

    private String msgCode;
    private String message;
    private String version = "1.0";
    private String token;
    private Object data;

    public static ReturnObjectBuilder createBuilder(){
        return new ReturnObjectBuilder();
    }

    public ReturnObjectBuilder mscCode(String msgCode){
        this.msgCode = msgCode;
        return this;
    }

    public ReturnObjectBuilder message(String message){
        this.message = message;
        return this;
    }

    public ReturnObjectBuilder version(String version){
        this.version = version;
        return this;
    }

    public ReturnObjectBuilder token(String token){
        this.token = token;
        return this;
    }

    public ReturnObjectBuilder data(Object data){
        this.data = data;
        return this;
    }

    public ReturnObject bulid(){
        ReturnObject<Object> returnObject = new ReturnObject();
        returnObject.setMessage(this.message);
        returnObject.setMsgCode(this.msgCode);
        returnObject.setToken(this.token);
        returnObject.setData(this.data);
        returnObject.setVersion(version);
        return returnObject;
    }

}
